<?php
/**
 * CreateTime: 2023/11/21 14:23
 * User:LinQ
 */

namespace Database\Seeders\Database;

use Illuminate\Database\Seeder;
use Illuminate\Support\Facades\DB;

class AuthSeeder extends Seeder
{
    public function run()
    {
        $isExists = DB::table('auth')->select('auth_id')->first();
        if(!$isExists){
            DB::table('auth')->insert(
               [
                   [
                       'auth_name' => '基本信息设置',
                       'com_id' => 1,
                       'auth_code' => 'BASIC_USER_SETTING',
                       'auth_type' => 1,
                       'auth_url' => null,
                       'created_at' => date("Y-m-d h:i:s"),
                       'updated_at' => date("Y-m-d h:i:s"),
                   ],
                   [
                       'auth_name' => '工作台',
                       'com_id' => 1,
                       'auth_code' => 'WORK_BENCHES',
                       'auth_type' => 2,
                       'auth_url' => '/usr/work_benches',
                       'created_at' => date("Y-m-d h:i:s"),
                       'updated_at' => date("Y-m-d h:i:s"),
                   ],
                   [
                       'auth_name' => '注销',
                       'com_id' => 1,
                       'auth_code' => 'CANCEL_ACCOUNT',
                       'auth_type' => 3,
                       'auth_url' => null,
                       'created_at' => date("Y-m-d h:i:s"),
                       'updated_at' => date("Y-m-d h:i:s"),
                   ],
               ]
            );
        }
    }
}